<table class="table table-striped table-bordered table-hover">
	<tr class="textBold">
		<th>STT</th>
		<th>ID</th>
		<th>Tên/ Tiêu đề</th>
		<th>Ngày cập nhật</th>
		<th>Tạo link</th>
	</tr>
	<?php
	// Đếm số thứ tự
// 	$No = ($current_page - 1) * $page_size;
	$No = 0;
	foreach ($items as $item ){
		$No++;
		switch ($item['c']["cat_type"]){
			case "news":
				$link = $this->Html->url(
					array(
						'controller' => 'news',
						'action' => 'detail',
						'full_base' => false,
						'news_rewrite' => $item['b']['dat_rewrite'],
						'ext' => 'html',
					)
				);
			break;
			case "static":
				$link = $this->Html->url(
					array(
						'controller' => 'statics',
						'action' => 'detail',
						'full_base' => false,
						'news_rewrite' => $item['b']['dat_rewrite'],
						'ext' => 'html',
					)
				);
			break;
			default:
				$link = $this->Html->url(
						array(
								'controller' => 'news',
								'action' => 'detail',
								'full_base' => false,
								'news_rewrite' => $item['b']['dat_rewrite'],
								'ext' => 'html',
						)
				);
			break;
		}

		$link = preg_replace('#/admin/#', '/', $link);
	?>
	<tr>
		<td class="No" align="center"><?php echo $No;?></td>
		<td align="center" class="text_normal_bold">
			<?php echo $item['b']["dat_id"];?>
		</td>
		<td>
			<div><a style="text-decoration:none" href="<?php echo $link;?>" target="_blank"><?php echo $item['b']["dat_title"];?></a></div>
			<div id="link_<?php echo $item['b']["dat_id"]?>"><?php echo $link;?></div>
		</td>
		<td align="center">
			<div><?php echo (isset($item['b']["dat_date"]) ? date("d/m/Y", $item['b']["dat_date"]) : "No update !")?></div>
			<div style="color:#666666; font-size:10px"><?php echo (isset($item['b']["dat_date"])) ? date("H:i A", $item['b']["dat_date"]) : '';?></div>
		</td>
		<td align="center"><img title="Tạo link" hspace="5" src="/admin/img/create_link.gif" style="cursor:pointer" onClick="link_to_data('<?php echo $link;?>')" /></td>
	</tr>
	<?php }?>
	</table>